package c.c.c.a.i.a;

import android.content.Context;
import c.c.c.a.f;
import c.c.c.a.h;
import c.c.c.a.n;

/* compiled from: BaseAssembly */
public abstract class c {
    public f a;
    public Context b;
    public h c = n.c.b;
    public b d;
    public d e;

    public c(f fVar, Context context, b bVar, d dVar) {
        this.a = fVar;
        this.b = context;
        this.d = bVar;
        this.e = dVar;
    }

    /* JADX WARNING: Removed duplicated region for block: B:122:0x0279 A:{Catch:{ Exception -> 0x0281 }} */
    /* JADX WARNING: Removed duplicated region for block: B:131:0x02f1 A:{Catch:{ all -> 0x02f5, all -> 0x03c1 }} */
    /* JADX WARNING: Removed duplicated region for block: B:130:0x02eb A:{Catch:{ all -> 0x02f5, all -> 0x03c1 }} */
    /* JADX WARNING: Removed duplicated region for block: B:114:0x0264 A:{Catch:{ Exception -> 0x026d }} */
    /* JADX WARNING: Removed duplicated region for block: B:122:0x0279 A:{Catch:{ Exception -> 0x0281 }} */
    /* JADX WARNING: Removed duplicated region for block: B:130:0x02eb A:{Catch:{ all -> 0x02f5, all -> 0x03c1 }} */
    /* JADX WARNING: Removed duplicated region for block: B:131:0x02f1 A:{Catch:{ all -> 0x02f5, all -> 0x03c1 }} */
    /* JADX WARNING: Missing exception handler attribute for start block: B:123:0x0281 */
    /* JADX WARNING: No exception handlers in catch block: Catch:{  } */
    /* JADX WARNING: Exception block dominator not found, dom blocks: [] */
    public c.c.c.a.e.a a(c.c.c.a.e.a r14) {
        /*
        r13 = this;
        if (r14 != 0) goto L_0x0007;
    L_0x0002:
        r14 = new c.c.c.a.e.a;
        r14.m1058init();
    L_0x0007:
        r0 = r13.d;
        r1 = "package_name";
        r2 = "activity";
        if (r0 == 0) goto L_0x00e4;
    L_0x000f:
        r3 = new org.json.JSONObject;
        r3.<init>();
        r4 = "last_create_activity";
        r5 = r0.g;	 Catch:{ JSONException -> 0x0067 }
        r6 = r0.h;	 Catch:{ JSONException -> 0x0067 }
        r5 = r0.a(r5, r6);	 Catch:{ JSONException -> 0x0067 }
        r3.put(r4, r5);	 Catch:{ JSONException -> 0x0067 }
        r4 = "last_start_activity";
        r5 = r0.i;	 Catch:{ JSONException -> 0x0067 }
        r6 = r0.j;	 Catch:{ JSONException -> 0x0067 }
        r5 = r0.a(r5, r6);	 Catch:{ JSONException -> 0x0067 }
        r3.put(r4, r5);	 Catch:{ JSONException -> 0x0067 }
        r4 = "last_resume_activity";
        r5 = r0.k;	 Catch:{ JSONException -> 0x0067 }
        r6 = r0.l;	 Catch:{ JSONException -> 0x0067 }
        r5 = r0.a(r5, r6);	 Catch:{ JSONException -> 0x0067 }
        r3.put(r4, r5);	 Catch:{ JSONException -> 0x0067 }
        r4 = "last_pause_activity";
        r5 = r0.m;	 Catch:{ JSONException -> 0x0067 }
        r6 = r0.n;	 Catch:{ JSONException -> 0x0067 }
        r5 = r0.a(r5, r6);	 Catch:{ JSONException -> 0x0067 }
        r3.put(r4, r5);	 Catch:{ JSONException -> 0x0067 }
        r4 = "last_stop_activity";
        r5 = r0.o;	 Catch:{ JSONException -> 0x0067 }
        r6 = r0.p;	 Catch:{ JSONException -> 0x0067 }
        r5 = r0.a(r5, r6);	 Catch:{ JSONException -> 0x0067 }
        r3.put(r4, r5);	 Catch:{ JSONException -> 0x0067 }
        r4 = "alive_activities";
        r5 = r0.b();	 Catch:{ JSONException -> 0x0067 }
        r3.put(r4, r5);	 Catch:{ JSONException -> 0x0067 }
        r4 = "finish_activities";
        r5 = r0.c();	 Catch:{ JSONException -> 0x0067 }
        r3.put(r4, r5);	 Catch:{ JSONException -> 0x0067 }
    L_0x0067:
        r4 = "activity_trace";
        r14.b(r4, r3);
        r3 = new org.json.JSONArray;
        r3.<init>();
        r0 = r0.b;	 Catch:{ Exception -> 0x00df }
        r0 = r0.getSystemService(r2);	 Catch:{ Exception -> 0x00df }
        r0 = (android.app.ActivityManager) r0;	 Catch:{ Exception -> 0x00df }
        if (r0 != 0) goto L_0x007c;
    L_0x007b:
        goto L_0x00df;
    L_0x007c:
        r4 = 5;
        r0 = r0.getRunningTasks(r4);	 Catch:{ Exception -> 0x00df }
        if (r0 != 0) goto L_0x0084;
    L_0x0083:
        goto L_0x00df;
    L_0x0084:
        r0 = r0.iterator();	 Catch:{ Exception -> 0x00df }
    L_0x0088:
        r4 = r0.hasNext();	 Catch:{ Exception -> 0x00df }
        if (r4 == 0) goto L_0x00df;
    L_0x008e:
        r4 = r0.next();	 Catch:{ Exception -> 0x00df }
        r4 = (android.app.ActivityManager.RunningTaskInfo) r4;	 Catch:{ Exception -> 0x00df }
        if (r4 == 0) goto L_0x0088;
    L_0x0096:
        r5 = r4.baseActivity;	 Catch:{ Exception -> 0x00df }
        if (r5 != 0) goto L_0x009b;
    L_0x009a:
        goto L_0x0088;
    L_0x009b:
        r5 = new org.json.JSONObject;	 Catch:{ JSONException -> 0x0088 }
        r5.<init>();	 Catch:{ JSONException -> 0x0088 }
        r6 = "id";
        r7 = r4.id;	 Catch:{ JSONException -> 0x0088 }
        r5.put(r6, r7);	 Catch:{ JSONException -> 0x0088 }
        r6 = r4.baseActivity;	 Catch:{ JSONException -> 0x0088 }
        r6 = r6.getPackageName();	 Catch:{ JSONException -> 0x0088 }
        r5.put(r1, r6);	 Catch:{ JSONException -> 0x0088 }
        r6 = "description";
        r7 = r4.description;	 Catch:{ JSONException -> 0x0088 }
        r5.put(r6, r7);	 Catch:{ JSONException -> 0x0088 }
        r6 = "number_of_activities";
        r7 = r4.numActivities;	 Catch:{ JSONException -> 0x0088 }
        r5.put(r6, r7);	 Catch:{ JSONException -> 0x0088 }
        r6 = "number_of_running_activities";
        r7 = r4.numRunning;	 Catch:{ JSONException -> 0x0088 }
        r5.put(r6, r7);	 Catch:{ JSONException -> 0x0088 }
        r6 = "topActivity";
        r7 = r4.topActivity;	 Catch:{ JSONException -> 0x0088 }
        r7 = r7.toString();	 Catch:{ JSONException -> 0x0088 }
        r5.put(r6, r7);	 Catch:{ JSONException -> 0x0088 }
        r6 = "baseActivity";
        r4 = r4.baseActivity;	 Catch:{ JSONException -> 0x0088 }
        r4 = r4.toString();	 Catch:{ JSONException -> 0x0088 }
        r5.put(r6, r4);	 Catch:{ JSONException -> 0x0088 }
        r3.put(r5);	 Catch:{ JSONException -> 0x0088 }
        goto L_0x0088;
    L_0x00df:
        r0 = "running_tasks";
        r14.b(r0, r3);
    L_0x00e4:
        r3 = c.c.c.a.n.b;
        r0 = "start_time";
        r5 = java.lang.Long.valueOf(r3);	 Catch:{ Exception -> 0x0109 }
        r14.b(r0, r5);	 Catch:{ Exception -> 0x0109 }
        r0 = new java.text.SimpleDateFormat;	 Catch:{ Exception -> 0x0109 }
        r5 = "yyyy_MM_dd_HH_mm_ss";
        r6 = java.util.Locale.getDefault();	 Catch:{ Exception -> 0x0109 }
        r0.<init>(r5, r6);	 Catch:{ Exception -> 0x0109 }
        r5 = new java.util.Date;	 Catch:{ Exception -> 0x0109 }
        r5.<init>(r3);	 Catch:{ Exception -> 0x0109 }
        r0 = r0.format(r5);	 Catch:{ Exception -> 0x0109 }
        r3 = "app_start_time_readable";
        r14.b(r3, r0);	 Catch:{ Exception -> 0x0109 }
        goto L_0x010d;
    L_0x0109:
        r0 = move-exception;
        r0.printStackTrace();
    L_0x010d:
        r0 = r13.b;
        r3 = 0;
        if (r0 != 0) goto L_0x0113;
    L_0x0112:
        goto L_0x0145;
    L_0x0113:
        r4 = r0.getPackageName();
        r0 = r0.getSystemService(r2);	 Catch:{ all -> 0x0145 }
        r0 = (android.app.ActivityManager) r0;	 Catch:{ all -> 0x0145 }
        if (r0 != 0) goto L_0x0120;
    L_0x011f:
        goto L_0x0145;
    L_0x0120:
        r0 = r0.getRunningAppProcesses();	 Catch:{ all -> 0x0145 }
        if (r0 == 0) goto L_0x0145;
    L_0x0126:
        r0 = r0.iterator();	 Catch:{ all -> 0x0145 }
    L_0x012a:
        r2 = r0.hasNext();	 Catch:{ all -> 0x0145 }
        if (r2 == 0) goto L_0x0145;
    L_0x0130:
        r2 = r0.next();	 Catch:{ all -> 0x0145 }
        r2 = (android.app.ActivityManager.RunningAppProcessInfo) r2;	 Catch:{ all -> 0x0145 }
        r5 = r2.importance;	 Catch:{ all -> 0x0145 }
        r6 = 100;
        if (r5 != r6) goto L_0x012a;
    L_0x013c:
        r0 = r2.pkgList;	 Catch:{ all -> 0x0145 }
        r0 = r0[r3];	 Catch:{ all -> 0x0145 }
        r0 = r4.equals(r0);	 Catch:{ all -> 0x0145 }
        goto L_0x0146;
    L_0x0145:
        r0 = 0;
    L_0x0146:
        r2 = 1;
        r0 = r0 ^ r2;
        r0 = java.lang.Boolean.valueOf(r0);
        r4 = "is_background";
        r14.b(r4, r0);
        r0 = android.os.Process.myPid();
        r0 = java.lang.Integer.valueOf(r0);
        r4 = "pid";
        r14.b(r4, r0);
        r0 = r13.e;
        r0 = r0.a;
        r0 = java.lang.Integer.valueOf(r0);
        r4 = "battery";
        r14.b(r4, r0);
        r0 = r13.c;
        r0 = r0.e();
        r4 = new org.json.JSONArray;
        r4.<init>();
        r5 = "plugin_info";
        if (r0 != 0) goto L_0x0180;
    L_0x017a:
        r0 = r14.a;	 Catch:{ Exception -> 0x01ae }
        r0.put(r5, r4);	 Catch:{ Exception -> 0x01ae }
        goto L_0x01ae;
    L_0x0180:
        r6 = r0.keySet();	 Catch:{ Exception -> 0x01ae }
        r6 = r6.iterator();	 Catch:{ Exception -> 0x01ae }
    L_0x0188:
        r7 = r6.hasNext();	 Catch:{ Exception -> 0x01ae }
        if (r7 == 0) goto L_0x01a9;
    L_0x018e:
        r7 = r6.next();	 Catch:{ Exception -> 0x01ae }
        r7 = (java.lang.String) r7;	 Catch:{ Exception -> 0x01ae }
        r8 = new org.json.JSONObject;	 Catch:{ Exception -> 0x01ae }
        r8.<init>();	 Catch:{ Exception -> 0x01ae }
        r8.put(r1, r7);	 Catch:{ Exception -> 0x01ae }
        r9 = "version_code";
        r7 = r0.get(r7);	 Catch:{ Exception -> 0x01ae }
        r8.put(r9, r7);	 Catch:{ Exception -> 0x01ae }
        r4.put(r8);	 Catch:{ Exception -> 0x01ae }
        goto L_0x0188;
    L_0x01a9:
        r0 = r14.a;	 Catch:{ Exception -> 0x01ae }
        r0.put(r5, r4);	 Catch:{ Exception -> 0x01ae }
    L_0x01ae:
        r0 = c.c.c.a.n.a;
        r0 = 0;
        r1 = r14.a;	 Catch:{ JSONException -> 0x01c0 }
        r4 = "miniapp_id";
        r1.put(r4, r3);	 Catch:{ JSONException -> 0x01c0 }
        r1 = r14.a;	 Catch:{ JSONException -> 0x01c0 }
        r4 = "miniapp_version";
        r1.put(r4, r0);	 Catch:{ JSONException -> 0x01c0 }
        goto L_0x01c4;
    L_0x01c0:
        r1 = move-exception;
        r1.printStackTrace();
    L_0x01c4:
        r1 = r13.c;
        r1 = r1.f();
        r4 = new org.json.JSONArray;
        r4.<init>();
        r5 = "patch_info";
        if (r1 == 0) goto L_0x01f2;
    L_0x01d3:
        r6 = r1.isEmpty();
        if (r6 == 0) goto L_0x01da;
    L_0x01d9:
        goto L_0x01f2;
    L_0x01da:
        r1 = r1.iterator();
    L_0x01de:
        r6 = r1.hasNext();
        if (r6 == 0) goto L_0x01ee;
    L_0x01e4:
        r6 = r1.next();
        r6 = (java.lang.String) r6;
        r4.put(r6);
        goto L_0x01de;
    L_0x01ee:
        r14.b(r5, r4);
        goto L_0x01f5;
    L_0x01f2:
        r14.b(r5, r4);
    L_0x01f5:
        r1 = r13.b;
        r4 = new org.json.JSONObject;
        r4.<init>();
        r5 = "inner_app_used";
        r6 = 0;
        r8 = r1.getFilesDir();	 Catch:{ Exception -> 0x020d }
        r8 = r8.getParentFile();	 Catch:{ Exception -> 0x020d }
        r8 = b.i.b.f.E(r8);	 Catch:{ Exception -> 0x020d }
        goto L_0x020e;
    L_0x020d:
        r8 = r6;
    L_0x020e:
        r4.put(r5, r8);	 Catch:{ Exception -> 0x0284 }
        r5 = "inner_free";
        r8 = android.os.Environment.getRootDirectory();	 Catch:{ Exception -> 0x0225 }
        r9 = new android.os.StatFs;	 Catch:{  }
        r8 = r8.getPath();	 Catch:{  }
        r9.<init>(r8);	 Catch:{  }
        r8 = r9.getFreeBytes();	 Catch:{  }
        goto L_0x0226;
    L_0x0225:
        r8 = r6;
    L_0x0226:
        r4.put(r5, r8);	 Catch:{ Exception -> 0x0284 }
        r5 = "inner_total";
        r8 = android.os.Environment.getRootDirectory();	 Catch:{ Exception -> 0x023d }
        r9 = new android.os.StatFs;	 Catch:{  }
        r8 = r8.getPath();	 Catch:{  }
        r9.<init>(r8);	 Catch:{  }
        r8 = r9.getTotalBytes();	 Catch:{  }
        goto L_0x023e;
    L_0x023d:
        r8 = r6;
    L_0x023e:
        r4.put(r5, r8);	 Catch:{ Exception -> 0x0284 }
        r5 = "sdcard_app_used";
        r8 = b.i.b.f.t();	 Catch:{ Exception -> 0x0258 }
        if (r8 == 0) goto L_0x0258;
    L_0x0249:
        r1 = r1.getExternalFilesDir(r0);	 Catch:{ Exception -> 0x0258 }
        if (r1 == 0) goto L_0x0258;
    L_0x024f:
        r1 = r1.getParentFile();	 Catch:{ Exception -> 0x0258 }
        r8 = b.i.b.f.E(r1);	 Catch:{ Exception -> 0x0258 }
        goto L_0x0259;
    L_0x0258:
        r8 = r6;
    L_0x0259:
        r4.put(r5, r8);	 Catch:{ Exception -> 0x0284 }
        r1 = "sdcard_free";
        r5 = b.i.b.f.t();	 Catch:{ Exception -> 0x026d }
        if (r5 == 0) goto L_0x026d;
    L_0x0264:
        r5 = android.os.Environment.getExternalStorageDirectory();	 Catch:{ Exception -> 0x026d }
        r8 = r5.getFreeSpace();	 Catch:{ Exception -> 0x026d }
        goto L_0x026e;
    L_0x026d:
        r8 = r6;
    L_0x026e:
        r4.put(r1, r8);	 Catch:{ Exception -> 0x0284 }
        r1 = "sdcard_total";
        r5 = b.i.b.f.t();	 Catch:{ Exception -> 0x0281 }
        if (r5 == 0) goto L_0x0281;
    L_0x0279:
        r5 = android.os.Environment.getExternalStorageDirectory();	 Catch:{ Exception -> 0x0281 }
        r6 = r5.getTotalSpace();	 Catch:{ Exception -> 0x0281 }
    L_0x0281:
        r4.put(r1, r6);	 Catch:{ Exception -> 0x0284 }
    L_0x0284:
        r1 = "storage";
        r14.b(r1, r4);
        r1 = c.c.c.a.n.a;
        r1 = c.c.c.a.n.d;
        r1 = new java.util.concurrent.CopyOnWriteArrayList;
        r1.<init>();
        r4 = 4;
        r4 = new java.lang.String[r4];
        r5 = "logcat";
        r4[r3] = r5;
        r3 = "-t";
        r4[r2] = r3;
        r3 = 512; // 0x200 float:7.175E-43 double:2.53E-321;
        r3 = java.lang.String.valueOf(r3);
        r6 = 2;
        r4[r6] = r3;
        r7 = "*:V";
        r8 = "*:D";
        r9 = "*:I";
        r10 = "*:W";
        r11 = "*:E";
        r12 = "*:F";
        r3 = new java.lang.String[]{r7, r8, r9, r10, r11, r12};
        r2 = r3[r2];
        r3 = 3;
        r4[r3] = r2;
        r2 = java.lang.Runtime.getRuntime();	 Catch:{ all -> 0x02f5 }
        r0 = r2.exec(r4);	 Catch:{ all -> 0x02f5 }
        r2 = new c.c.c.a.i.f;	 Catch:{ all -> 0x02f5 }
        r3 = r0.getInputStream();	 Catch:{ all -> 0x02f5 }
        r2.m1079init(r3, r1);	 Catch:{ all -> 0x02f5 }
        r2.start();	 Catch:{ all -> 0x02f5 }
        r2 = new c.c.c.a.i.f;	 Catch:{ all -> 0x02f5 }
        r3 = r0.getErrorStream();	 Catch:{ all -> 0x02f5 }
        r2.m1079init(r3, r1);	 Catch:{ all -> 0x02f5 }
        r2.start();	 Catch:{ all -> 0x02f5 }
        r2 = new c.c.c.a.i.g;	 Catch:{ all -> 0x02f5 }
        r3 = 3000; // 0xbb8 float:4.204E-42 double:1.482E-320;
        r2.m1080init(r0, r3);	 Catch:{ all -> 0x02f5 }
        r2.start();	 Catch:{ all -> 0x02f5 }
        r2 = android.os.Build.VERSION.SDK_INT;	 Catch:{ all -> 0x02f5 }
        r6 = 26;
        if (r2 < r6) goto L_0x02f1;
    L_0x02eb:
        r2 = java.util.concurrent.TimeUnit.MILLISECONDS;	 Catch:{ all -> 0x02f5 }
        r0.waitFor(r3, r2);	 Catch:{ all -> 0x02f5 }
        goto L_0x02fb;
    L_0x02f1:
        r0.waitFor();	 Catch:{ all -> 0x02f5 }
        goto L_0x02fb;
    L_0x02f5:
        r2 = move-exception;
        r2.printStackTrace();	 Catch:{ all -> 0x03c1 }
        if (r0 == 0) goto L_0x02fe;
    L_0x02fb:
        r0.destroy();
    L_0x02fe:
        r0 = new org.json.JSONArray;
        r0.<init>();
        r1 = r1.iterator();
    L_0x0307:
        r2 = r1.hasNext();
        if (r2 == 0) goto L_0x0317;
    L_0x030d:
        r2 = r1.next();
        r2 = (java.lang.String) r2;
        r0.put(r2);
        goto L_0x0307;
    L_0x0317:
        r14.b(r5, r0);
        r0 = r13.c;
        r0 = r0.d();
        r1 = android.text.TextUtils.isEmpty(r0);
        if (r1 != 0) goto L_0x032b;
    L_0x0326:
        r1 = "session_id";
        r14.b(r1, r0);
    L_0x032b:
        r0 = c.c.c.a.n.a;
        r0 = "business";
        r1 = "default";
        r14.b(r0, r1);
        r0 = c.c.c.a.n.e;
        r0 = r0.b;
        if (r0 == 0) goto L_0x0365;
    L_0x033a:
        r1 = new org.json.JSONObject;
        r1.<init>();
        r2 = r0.keySet();
        r2 = r2.iterator();
    L_0x0347:
        r3 = r2.hasNext();
        if (r3 == 0) goto L_0x0360;
    L_0x034d:
        r3 = r2.next();
        r3 = (java.lang.String) r3;
        r4 = r0.get(r3);	 Catch:{ JSONException -> 0x035b }
        r1.put(r3, r4);	 Catch:{ JSONException -> 0x035b }
        goto L_0x0347;
    L_0x035b:
        r3 = move-exception;
        r3.printStackTrace();
        goto L_0x0347;
    L_0x0360:
        r0 = "filters";
        r14.b(r0, r1);
    L_0x0365:
        r0 = java.util.UUID.randomUUID();
        r0 = r0.toString();
        r1 = "crash_uuid";
        r14.b(r1, r0);
        r0 = c.c.c.a.n.e;
        r1 = r13.a;
        r0 = r0.a;
        r0 = r0.get(r1);
        r0 = (java.util.List) r0;
        if (r0 == 0) goto L_0x03c0;
    L_0x0380:
        r1 = new org.json.JSONObject;
        r1.<init>();
        r0 = r0.iterator();
    L_0x0389:
        r2 = r0.hasNext();
        if (r2 == 0) goto L_0x03bb;
    L_0x038f:
        r2 = r0.next();
        r2 = (c.c.c.a.b) r2;
        r3 = r13.a;
        r2 = r2.a(r3);
        if (r2 == 0) goto L_0x0389;
    L_0x039d:
        r3 = r2.keySet();	 Catch:{ all -> 0x03b9 }
        r3 = r3.iterator();	 Catch:{ all -> 0x03b9 }
    L_0x03a5:
        r4 = r3.hasNext();	 Catch:{ all -> 0x03b9 }
        if (r4 == 0) goto L_0x0389;
    L_0x03ab:
        r4 = r3.next();	 Catch:{ all -> 0x03b9 }
        r4 = (java.lang.String) r4;	 Catch:{ all -> 0x03b9 }
        r5 = r2.get(r4);	 Catch:{ all -> 0x03b9 }
        r1.put(r4, r5);	 Catch:{ all -> 0x03b9 }
        goto L_0x03a5;
        goto L_0x0389;
    L_0x03bb:
        r0 = "custom";
        r14.b(r0, r1);
    L_0x03c0:
        return r14;
    L_0x03c1:
        r14 = move-exception;
        if (r0 == 0) goto L_0x03c7;
    L_0x03c4:
        r0.destroy();
    L_0x03c7:
        throw r14;
        */
        throw new UnsupportedOperationException("Method not decompiled: c.c.c.a.i.a.c.a(c.c.c.a.e.a):c.c.c.a.e.a");
    }
}
